<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style type="text/css">
			* {
				margin: 0;
				padding: 0;
			}

			#wrap {
				position: absolute;
				left: 50%;
				top: 50%;
				margin-left: -100px;
				margin-top: -100px;

				width: 400px;
				height: 400px;
				border: 1px solid;

				text-align: center;
				font: 50px/200px "agency fb";
				/* transition: 1s; */
				
				background: gray;
				
				perspective: 300px;
				
				/*
				开启3D舞台效果，这样旋转.inner就能转到背景后面去。
				这是一个不可继承属性 作用于子元素
				*/
				transform-style: preserve-3d;
			}

			.inner {
				position: absolute;
				left: 200px;
				top: 200px;
				margin-left: -100px;
				margin-top: -100px;

				width: 200px;
				height: 200px;
				border: 1px solid;

				background: pink;

				text-align: center;
				font: 50px/200px "agency fb";
				
				/*
				这里注意要远离观察者 100px 也就是Z轴
				*/
				transform: rotateX(0deg) translateZ(100px);
			}
		</style>
	</head>
	<body>
		<div id="wrap">
			<div class="inner">123</div>
		</div>
	</body>
</html>
